package com.yzf.demo.demo.Thread;

/**
 * Created by 于占峰 on 2020/3/28/028.
 * 实现Runnable 实现run方法
 */
public class RunnableDemo implements Runnable {
    @Override
    public void run() {
        System.out.println("当前线程:" + Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        //实例化该类
        RunnableDemo runnableDemo = new RunnableDemo();
        //创建线程 并将类作为参数传入
        Thread thread = new Thread(runnableDemo);
        //调用thread的start方法
        thread.start();
    }
}
